import axios from '@/axios'
import apiUrl from '../urls/article'

export default {

    fetchList: (query) => {
        return axios.request({
            url: apiUrl.fetchList,
            method: 'get',
            params: query
        })
    },
    fetchArticle: (query) => {
        return axios.request({
            url: apiUrl.fetchArticle,
            method: 'get',
            params: { query }
        })
    },
    fetchPv: (pv) => {
        return axios.request({
            url: apiUrl.fetchPv,
            method: 'get',
            params: { pv }
        })
    },
    createArticle: (data) => {
        return axios.request({
            url: apiUrl.createArticle,
            method: 'post',
            data
        })
    },
    updateArticle(data) {
        return axios.request({
            url: apiUrl.updateArticle,
            method: 'post',
            data
        })
    },

}